﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
using A = DocumentFormat.OpenXml.Drawing;
using DW = DocumentFormat.OpenXml.Drawing.Wordprocessing;
using PIC = DocumentFormat.OpenXml.Drawing.Pictures;
using System.IO;
using System.Reflection;
namespace TestDrive
{
    class _testEntry
    {
        static void Main()
        {
            // Task tsk = new Task();
            //  tsk.FilePath = "g:\\testdrive\\1.docx";
            //   tsk.DebugRun();
            //      Task tsk = new Task() { FilePath = "g:\\testdrive\\hello.docx", taskType = TaskType.OpenXML };
            //  tsk.Initialize();
            // tsk.AddAChecker(pap);
            //    intelliEssay.Checker.PaperLayoutAndParagraphAlignmentChecker papac = new Checker.PaperLayoutAndParagraphAlignmentChecker();
            //    tsk.AddAChecker(papac);
            //    tsk.DebugRun();
            /*    for (int i = 0; i < 10; i++)
                {
                    intelliEssay.Core.EssayException ee = new EssayException(null, tsk);
                    ee.task = tsk;
                    ee.faultyElement = ome[1];
                    ee.GenerateMarkUpsByOpenXmlObject();
                }*/
            //   tsk.TaskObjectRoot.Dispose();
            // mdp.Document.Save();
            // InsertAPicture("g:\\testdrive\\1.docx", @"E:\ProjectEssayCompiler\TestDrive\intelliEssayCore\bin\Debug\error.jpg");

        }
        public static void foo()
        {
            throw new ApplicationException();
        }
    }
    /*  public class BugCollection
      {
          public static List<intelliEssayException> bugCollection = new List<intelliEssayException>();
          public static void LoadBugCollection()
          {
              XmlSerializer xmlSerializer = new XmlSerializer(typeof(List<intelliEssayException>));
              bugCollection = (List<intelliEssayException>)xmlSerializer.Deserialize(System.IO.File.Open("BugCollection.xml", System.IO.FileMode.OpenOrCreate));
          }
          public static void SaveBugCollection()
          {
              XmlSerializer xmlSerializer = new XmlSerializer(typeof(List<intelliEssayException>));
              xmlSerializer.Serialize(System.IO.File.Open("BugCollection.xml", System.IO.FileMode.OpenOrCreate), bugCollection);
          }
      }*/
    /// <summary>
    /// This class provides Debugging-Friendly methods
    /// </summary>
    public static class DebugHandy
    {
        public static string ShowMe(this IEnumerable<Paragraph> paras)
        {
            StringBuilder sb = new StringBuilder();
            foreach (Paragraph p in paras)
            {
                sb.Append(p.InnerText+Environment.NewLine);
            }
            return sb.ToString();
        }
    }
}
